<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>

<html>
	<head>
	</head>
	<link rel="stylesheet" type="text/css" href="lucar-css/head-css.css" />
	<link rel="stylesheet" type="text/css" href="lucar-css/payorders-css.css">

	<body>
	  	<div id="head">
			<div id="h-logo">
				<img src="lucar-image/logo.png" class="hl">
			</div>
			<div id="h-right">
				<span id="hr-useCar" class="hr-span" onmouseover="headimg(1);" onMouseOut="headimg(2);">
					<img id="uCOut" src="lucar-image/useCar-Out.png" class="hr-image" style="display:block">
					<img id="uCOn" src="lucar-image/useCar-On.png" class="hr-image" style="display:none">
				</span>
				<span id="hr-aboutUs" class="hr-span" onmouseover="headimg(3);" onMouseOut="headimg(4);">
					<img id="aUOut" src="lucar-image/aboutUs-Out.png" class="hr-image" style="display:block">
					<img id="aUOn" src="lucar-image/aboutUs-On.png" class="hr-image" style="display:none">
				</span>
				<span id="register" class="button" onMouseOver="headbutton(1);" onMouseOut="headbutton(2);"><b class="hr-text">注册</b></span>
				<span id="login" class="button" onMouseOver="headbutton(3);" onMouseOut="headbutton(4);"><b class="hr-text">登录</b></span>
			</div>
		</div>
		<div id="order_div">
			<jsp:useBean id="time" class="java.util.Date"/> 
			<s:form action="payOrders" namespace="/">
				<%@ page import="java.util.*,order.domain.Orders,car.domain.CarInfo,car.dao.*,order.service.*"%>
				<% 
					request.setCharacterEncoding("utf-8");
					OrderService orderService=new OrderServiceImpl();
					Orders order1=orderService.searchPayOrder("1002");
					Orders orders=(Orders)session.getAttribute("payOrders");
					float money=(float)(orders.getUsePower()*1.5);
					session.setAttribute("money", money);
					
					String carId=orders.getCarId();
				   CarInfoDao dao=new CarInfoDaoImpl();
				   CarInfo carInfo=(CarInfo)dao.selectCar("select c from CarInfo c where c.carId='"+carId+"'");
				   
					 %>
			<div id="order_head">
				<label id="orderNo">订单号：</label></label><s:textfield id="orderNo_input" name="orders.orderNo" value="%{#session.payOrders.orderNo}" readonly="true"/>
				<label id="beginPark">借车点：</label><span id="beginPark_input"><%=orders.getBeginParkId() %></span>
				<label id="beginTime">下单时间：</label><span id="beginTime_input"><%=orders.getBeginTime() %></span>
			</div>
            <div id="order-show">
            	<div id="carImg"></div>
                <span id="carId_span">汽车ID：</span>
            	<span id="carId_input"><%=orders.getCarId() %></span>
				<span id="carName_span">汽车名称：</span>
				<span id="carName"><%=carInfo.getCarName() %></span>
				<span id="carType_span">汽车类型：</span>
				<span id="carType"><%=carInfo.getCarType() %></span>
				<span id="power_span">使用电量：</span>
				<span id="power"><%=orders.getUsePower() %>%</span>
                <span id="userId_span">用户名：</span>
                <s:textfield id="userId" name="orders.userId" value="%{#session.payOrders.userId}" readonly="true"/>
            	<span id="userName_span">用户姓名：</span>
				<span id="userName">曾子隽</span>
            	<span id="endPark">还车点：</span>
				<span id="endParkId"><%=orders.getEndParkId() %></span>
                <span id="orderStatus_span">订单金额：</span>
				<s:textfield id="orderStatus" name="orders.money" value="%{#session.money}" readonly="true"/>
            </div>
				<s:submit value="支付" id="orderSubmit"/>
			</s:form>
		</div>
	</body>

	<script src="lucar-script/head-script.js"></script>
	<script type="text/javascript">
	window.onload = function(){
		function box(){
			var oBox = document.getElementById("index-body");
			var L1 = oBox.offsetWidth;
			var Left = (document.documentElement.clientWidth-L1)/2;
			oBox.style.left = Left+'px';
		}
		box();
		window.onresize = function(){
			box();
		}
	}
	</script>
	
</html>